Skip to content

Conversation

@ausbin
Copy link
Contributor

@ausbin ausbin commented Sep 15, 2025

Posting as a draft PR because there are are some interesting build errors when I run cargo test in my static-build fork (I assume they'd happen here too):

error: macros that expand to items must be delimited with braces or followed by a semicolon
   --> melior/src/dialect/ods.rs:180:1
    |
180 | / melior_macro::dialect! {
181 | |     name: "tosa",
182 | |     files: ["mlir/Dialect/Tosa/IR/TosaOps.td"],
183 | | }
    | |_^
    |
    = note: this error originates in the macro `melior_macro::dialect` (in Nightly builds, run with -Z macro-backtrace for more info)

error: invalid ODS input: Included from :1:
       Included from /home/austin/bin/llvm21/include/mlir/Dialect/Tosa/IR/TosaOps.td:17:
       Included from /home/austin/bin/llvm21/include/mlir/IR/OpBase.td:18:
       Included from /home/austin/bin/llvm21/include/mlir/IR/Interfaces.td:16:
       Included from /home/austin/bin/llvm21/include/mlir/IR/AttrTypeBase.td:17:
       /home/austin/bin/llvm21/include/mlir/IR/CommonAttrConstraints.td:31:8: error: invalid conversion from Invalid to alloc::string::String
         code storageType = ?; // The backing mlir::Attribute type
              ^
   --> melior/src/dialect/ods.rs:180:1
    |
180 | / melior_macro::dialect! {
181 | |     name: "tosa",
182 | |     files: ["mlir/Dialect/Tosa/IR/TosaOps.td"],
183 | | }
    | |_^
    |
    = note: this error originates in the macro `melior_macro::dialect`

However, I hope this PR still saves the maintainers a few minutes of time, particularly the updated pass names.

Requires mlir-rs/mlir-sys#71 and mlir-rs/tblgen-rs#28 (or equivalent changes)

@ausbin ausbin changed the title Upgrade to LLVM 21 WIP: Upgrade to LLVM 21 Sep 15, 2025
raviqqe pushed a commit to mlir-rs/tblgen-rs that referenced this pull request Sep 20, 2025
`cargo test` passes at least. Although I also updated `setup.sh`, it
looks like [`llvm@21` may not exist in Homebrew yet][1]. @femtomc's
changes in mlir-rs/mlir-sys#71 suggest an alternative way to install
LLVM in CI.

Still, this works end-to-end with Melior for my use cases when combined
with mlir-rs/mlir-sys#71 and mlir-rs/melior#731, if that is useful to
know.

I don't know if this warrants a version bump as
#25 did (seems like the
maintainer's call)

(Succeeds #28 which I made from the wrong branch)

[1]: https://formulae.brew.sh/formula/
@raviqqe raviqqe changed the base branch from main to dependabot/cargo/mlir-sys-210.0.0 November 4, 2025 02:41
@raviqqe raviqqe marked this pull request as ready for review November 4, 2025 02:44
@raviqqe raviqqe merged commit 09ff37c into mlir-rs:dependabot/cargo/mlir-sys-210.0.0 Nov 4, 2025
6 of 14 checks passed
@raviqqe
Copy link
Member

raviqqe commented Nov 4, 2025

Thank you for the changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants